home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9968 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: casbah.acns.nwu.edu!muzaffar
  2. From: muzaffar@casbah.acns.nwu.edu (Usman Muzaffar)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: help!
  5. Date: 14 Mar 1996 19:05:39 GMT
  6. Organization: Northwestern University, Evanston IL
  7. Message-ID: <4i9qm3$i28@news.acns.nwu.edu>
  8. References: <4i9m2k$jcr@kirin.wwa.com>
  9. NNTP-Posting-Host: casbah.acns.nwu.edu
  10. Keywords: C question?
  11.  
  12. In article <4i9m2k$jcr@kirin.wwa.com>,
  13. Shriram Venkatraman <shriramv@wwa.com> wrote:
  14. >whats the difference between malloc and realloc?
  15.  
  16. Quoting directly from K&R 2nd ed, p. 252:
  17.  
  18. void *malloc(size_t size)
  19. returns a pointer to a space for an object of size _size_, or NULL
  20. if request cannot be satisfied. The space is uninitialized.
  21.  
  22. void *realloc(void *p,size_t size)
  23. changes the size of the object pointed to by p to size. The contents
  24. will be unchanged up to the minimum of the old and new sizes. If the
  25. new size is larger, the new space is uninitialized. realloc returns
  26. a pointer to the new space, or NULL if request can not be satisfied,
  27. in which case *p is unchanged.
  28.  
  29.  
  30.  
  31.  
  32.